﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EpubFactory.Template.Domain
{
    public class Identifier
    {
        public enum Scheme
        {
            UUID,
            ISBN,
            URL,
            URI
        }
        public Scheme Schema { get; set; }
        public String Value { get; set; }
        public bool IsBookId { get; set; }
        public static Identifier getBookIdIdentifier(List<Identifier> identifiers)
        {
            if (identifiers == null || !identifiers.Any())
            {
                return null;
            }
            var m = identifiers.FirstOrDefault(s => s.IsBookId);
            if (m == null)
            {
                return identifiers.First();
            }
            return m;
        }
    }
}
